package com.beta.em.admins;

import java.util.Objects;

/**
 * Created by lichao on 2017/1/6.
 */
public enum CourierStatusType {

    AVAILABLE("available","已激活"),
    UNAVALIBLE("unavalible","停用");

    private String value;
    private String cnValue;

    CourierStatusType(String value,String cnValue){
        this.value = value;
        this.cnValue = cnValue;
    }


    public static CourierStatusType getCourierStatusType(String value) {
        for (CourierStatusType type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        return null;
    }

    public static String getCnValue(String value){
        CourierStatusType type=getCourierStatusType(value);
        if(Objects.nonNull(type)){
            return type.cnValue;
        }
        return "";
    }
}